Log in Register Dashboard Temp Share Shortlinks Frames API

cody - HTMLify profile

cody's Profile Picture

cody

4270 Files

632542 Views

Latest files of /cody/solygambas/html-css-javascript-projects/015-incrementing counter

style.css cody/solygambas/html-css-javascript-projects/015-incrementing counter/style.css
132 Views
0 Comments
@import url("https://fonts.googleapis.com/css2?family=Roboto+Mono&display=swap");

* {
box-sizing: border-box;
}

body {
background-color: #8e44ad;
index.html cody/solygambas/html-css-javascript-projects/015-incrementing counter/index.html
346 Views
0 Comments
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css"
script.js cody/solygambas/html-css-javascript-projects/015-incrementing counter/script.js
209 Views
0 Comments
const counters = document.querySelectorAll(".counter");

counters.forEach((counter) => {
counter.innerText = "0";
const updateCounter = () => {
const target = +counter.getAttribute("data-target");
const count = +counter.innerText;
const increment = target / 200;